<script>
	import {miniapp,userinfo} from '@/api/user.js'
	export default {
		onLaunch: function() {
			console.log('App Launch')
			let that = this
			uni.login({
				provider: 'weixin',
				success: function(loginRes) {
					console.log(loginRes.code);
					miniapp({code:loginRes.code}).then(res=>{
						uni.setStorageSync("token", res.data.token)
						userinfo().then(res=>{
							uni.setStorageSync("user", res.data)
						})
					})
				}
			});
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	/* 注意要写在第一行，同时给style标签加入lang="scss"属性 */
	@import "uview-ui/index.scss";
	page {
		background-color: #F8F8F8;
		font-family: PingFang SC-Semibold, PingFang SC;
	}
	.rich_val {
		word-break: break-all;
		white-space: pre-line;
	}
	.custom_btn {
		border: none;
		background-color: transparent !important;
		width: auto;
		overflow: auto;
		box-shadow: none !important;
		margin-top: -40rpx;
	}
	.custom_btn::after {
		border: none;
		height: auto;
	}
	.custom_style {
		color: #fff;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		font-size: 24rpx;
	
		&_img {
			width: 68rpx;
			height: 72rpx;
	
			img {
				width: 68rpx;
				height: 72rpx;
			}
		}
	
		&_text {
			margin-top: 12rpx;
			width: 172rpx;
			height: 40rpx;
			background: linear-gradient(180deg, #F06856 0%, #CE3026 100%);
			border-radius: 100rpx 100rpx 100rpx 100rpx;
			opacity: 1;
			font-size: 24rpx;
			font-family: PingFang SC-Semibold, PingFang SC;
			font-weight: 600;
			color: #FFFFFF;
			display: flex;
			justify-content: center;
			align-items: center;
		}
	}
</style>